package com.dc.entity.special;


import com.dc.entity.ShipRepairEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.util.Date;

/**
 *  5-0 其他油耗-单船
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "t_workflow_special_1_other_oil_ship")
public class WorkflowSpecial1OtherOilShipEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    @Column(name = "ship_repair_id", columnDefinition = "bigint unsigned NOT NULL", insertable = false, updatable = false)
    private Long shipRepairId;      // 维修记录 外键id

    @Column(name = "submit_time")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date submitTime;        // 填写日期

    @Column(name = "ship_name", length = 50)
    private String shipName;        // 船体名称

    @Column(name = "reporter", length = 20)
    private String reporter;        // 填报人

    ////////////////////////////////////////////

    @JsonFormat(pattern = "yyyy-MM-dd")
    @Temporal(TemporalType.DATE)
    @Column(name = "picking_date")
    private Date pickingDate;       // 领料日期

    @Column(name = "department", length = 50)
    private String department;      // 领料部门

    @Column(name = "type", length = 30)
    private String type;            // 事务类型

    @Column(name = "project_code", length = 20)
    private String projectCode;     // 领用项目编码

    @Column(name = "project_name", length = 20)
    private String projectName;     // 领用项目名称

    @Column(name = "material_name", length = 200)
    private String materialName;    // 物料名称

    @Column(name = "send_num")
    private Integer sendNum;        // 发货数量

    @Column(name = "unit", length = 10)
    private String unit;            // 单位

    @Column(name = "supplier", length = 50)
    private String supplier;        // 供应商

    ////////////////////////////////////////////

    @JsonIgnore
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ship_repair_id")
    private ShipRepairEntity shipRepairEntity;

}
